var pic;
chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
    if(request.topic == "fsPic"){
    	pic || (pic = new PIC());
        if(!pic.serial || pic.serial.length == 0){
            var title = document.title;
            var imgs = document.querySelectorAll("img");
            var imgSrcs = [];
            for(var i = 0 ; i < imgs.length; i++){
            	imgs[i].src && imgSrcs.push(imgs[i].src);
            }
            pic.addSerial(title , imgSrcs);
        }
        pic.show("fullscreen");
    }
}); 
